package com.zlp.clazz;

import sun.misc.Launcher;

import java.net.URL;
import java.security.Provider;

/**
 * 测试类的加载时机
 */
public class ClassLoaderDemo_2 {
    public static void main(String[] args) {

        System.out.println(ClazzLoaderDemo_1.class.getClassLoader());
        System.out.println("**************启动类加载器***************");
        URL[] urLs = Launcher.getBootstrapClassPath().getURLs();
        for (URL url:urLs){
            System.out.println(url.toExternalForm());
        }
        System.out.println(Provider.class.getClassLoader());
        System.out.println("**************扩展类加载器***************");
        String paths = System.getProperty("java.ext.dirs");
        for (String path:paths.split(";")){
            System.out.println(path);
        };
    }
}
